/*
 * File:   FIFold.h
 * Author: Santiago Videla <santiago.videla at gmail.com>
 *
 * Created on September 26, 2010, 5:25 PM
 *
 * Copyright (C) 2010  Santiago Videla, FuDePAN
 *
 * This file is part of fideo
 *
 * fideo is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * fideo is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with fideo.  If not, see <http://www.gnu.org/licenses/>.
 *
 */

#ifndef _FIFOLD_H
#define _FIFOLD_H

#include <biopp/biopp.h>
#include "rna_backends_types.h"
#include "rna_backends_exceptions.h"

/**
 * Interface for sequence's folding services.
 */

namespace Fudeo // L3; r-emo=L4
{

class FIFold
{
public:
    typedef size_t JobID;

    struct NucSeqIterator
    {
        virtual bool getNext(JobID jobID, biopp::NucSequence& seqRNAm, bool& isCirc) = 0;
    };

    struct FoldObserver
    {
        virtual void acceptStruct(JobID jobID, const biopp::SecStructure& structureRNAm) = 0;
    };

    void distributeWork(NucSeqIterator* iterator, FoldObserver* observer);

    /**
     * Fold an ARN sequence
     * @param sequence the ARN sequence to fold.
     * @param structure the structure where to write the folding.
     * @param circ if the structure it's circular.
     * @return The free energy in the structure.
     */
    //virtual Fe fold(const biopp::NucSequence& seqRNAm, biopp::SecStructure& structureRNAm, bool isCircRNAm) const = 0;

    virtual ~FIFold() {}
};

}
#endif  /* _FIFOLD_H */

